#! /usr/bin/env python2.5
from p60 import isPrime

maxn=0
ab=0
for a in range(-999,1000):
    for b in range(-999,1000):
        n=0
        while (n*n+a*n+b) > 0 and isPrime(n*n+a*n+b):
            n+=1
        if n>maxn:
            maxn=n
            ab=a*b

print ab


